package com.liangdemo.web.test.constructor;

/**
 * @author Mr.Liang
 * @date 2022/5/19 10:36
 */

public class Car {
    String name;
    double price;

    /**
     * 无参构造器
     */
    public Car() {
        System.out.println("无参构造器被调用");
    }

    /**
     * 有参构造器
     */
    public Car(String name, double price) {
        System.out.println("有参构造器被调用");
        this.name = name;
        this.price = price;
    }
}
